import { Redirect } from 'umi'
import React from 'react'
import {getToken} from '@/utils/index'
  const AuthWrapper:React.FC=(props) => {
//保存登录态
const isLogin =!!getToken();

  if (isLogin) {
    return <div>{ props.children }</div>;
  } else {
    return <Redirect to="/login" />;
  }
}

export default  AuthWrapper;